package com.itheima.job;

import lombok.Data;

public class TestDemo2 {
    public static void main(String[] args) {
        Employee e = new Employee() {
            @Override
            void work() {
                System.out.println("工号为" + this.getId() + "的员工" + this.getName() + "正在努力的敲代码");}
        };
        e.setId("001");
        e.setName("范冰冰");
        e.work();
    }
}

@Data
abstract class Employee{
    private String id;
    private String name;

    abstract void work();

    public Employee(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public Employee() {
    }
}
